﻿using Core.DomainServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.DomainServices
{
    public class ExportDocument
    {
        private readonly IAppConfig appConfig;

        public ExportDocument(IAppConfig appConfig)
        {
            this.appConfig = appConfig;
        }

        public IList<string> Export(string workingFolder)
        {
            IList<IDocumentService> items = new List<IDocumentService>()
            {
                new ExportToWordV1(new ExcelRepository(), appConfig)
                
            };

            IList<string> results = new List<string>();
            Parallel.ForEach<IDocumentService>(items,
                       item =>
                           results = item.Export(workingFolder)
            );
            
            return results;
        }
    }
}
